const { Application } = require("egg");
const { app } = require("egg-mock");

module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const userSchema = new Schema({
        // 用户名
        user: { type: String },
        // 用户唯一标识
        openid: { type: String },
        // 创建用户的时间
        creatTime: { type: Date, default: Date.now },
        // 用户预计的数据表
        expectData: { type: Schema.Types.ObjectId }
    });
    return mongoose.model('User', userSchema);  //返回model
}